import Ciallo from "@/api/Ciallo";
// 
export default function Ciallo3API(Mode) {
    const datas = arguments
    const urls = [
        "/secondDirectoryListAll",//查
        "/addsecond",//增
        "/updatesecond",//改
        "/deletesecond",//删
        "/parent_directory",//查
    ]
    const fns = {
        "/secondDirectoryListAll": new Map([["page", datas[1]], ["limit", datas[2]], ["name", datas[3]]]),//查
        "/addsecond": new Map([["pid", datas[1]], ["name", datas[2]]]),//增
        "/updatesecond": new Map([["id", datas[1]], ["pid", datas[2]], ["name", datas[3]]]),//改
        "/deletesecond": new Map([["ids", datas[1]]]),//删    
        "/parent_directory": new Map([]),//查  
    }

    const url = urls[Mode]
    const data = {}
    fns[url].forEach((k, v) => { Reflect.set(data, v, k) })
    const method = Mode == 4 ? "get" : "post"
    return Ciallo({
        url: url,
        method: method,
        params: { ...data }
    })

}